<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;

class UserFollow extends Model
{
    use HasDateTimeFormatter;

    protected $fillable = [
        'user_id',
        'friend_id'
    ];

    public function friend()
    {
        return $this->belongsTo(User::class,'friend_id');
    }

    public function firm()
    {
        return $this->belongsTo(Firm::class,'friend_id','user_id');
    }

//    public function article()
//    {
//        return $this->belongsTo(Article::class,'friend_id','user_id')
//                    ->orderByDesc('id');
//    }
}
